package com.tanhua.dubbo.api;

import com.tanhua.dubbo.enums.CommentType;
import com.tanhua.dubbo.pojo.Comment;
import com.tanhua.dubbo.pojo.Publish;
import com.tanhua.dubbo.pojo.Video;
import com.tanhua.dubbo.vo.PageInfo;

public interface QuanZiApi {

    /**
     * 查询好友动态
     *
     * @param userId 用户id
     * @param page 当前页数
     * @param pageSize 每一页查询的数据条数
     * @return
     */
    PageInfo<Publish> queryPublishList(Long userId, Integer page, Integer pageSize);

    /**
     * 发布动态
     *
     * @param publish
     * @return 发布成功返回动态id
     */
    String savePublish(Publish publish);

    /**
     * 查询推荐动态
     *
     * @param userId 用户id
     * @param page 当前页数
     * @param pageSize 每一页查询的数据条数
     * @return
     */
    PageInfo<Publish> queryRecommendPublishList(Long userId, Integer page, Integer pageSize);

    /**
     * 根据id查询动态
     *
     * @param id 动态id
     * @return
     */
    Publish queryPublishById(String id);

    Video queryVideoById(String vid);

    Comment queryCommentById(String id);

    /**
     * 点赞
     *
     * @param userId
     * @param publishId
     * @return
     */
    Boolean likeComment(Long userId, String publishId);

    Boolean likeCommentVideo(Long userId, String videoId);

    /**
     * 取消点赞
     *
     * @param userId
     * @param publishId
     * @return
     */
    Boolean disLikeComment(Long userId, String publishId);

    /**
     * 查询点赞数
     *
     * @param publishId
     * @return
     */
    Long queryLikeCount(String publishId);

    /**
     * 查询用户是否点赞该动态
     *
     * @param userId
     * @param publishId
     * @return
     */
    Boolean queryUserIsLike(Long userId, String publishId);

    /**
     * 查询相册表
     *
     * @param userId
     * @param page
     * @param pageSize
     * @return
     */
    PageInfo<Publish> queryAlbumList(Long userId, Integer page, Integer pageSize);

    public Boolean queryUserIsLikeVideo(Long userId, String videoId);

    PageInfo<Comment> qureyLikeCommentListByUser(Long userId, Integer page, Integer pageSize);

    PageInfo<Comment> qureyLoveCommentList(Long userId, Integer page, Integer pageSize);

    PageInfo<Comment> qureyCommentsCommentList(Long userId, Integer page, Integer pageSize);


    //Integer queryCountByUserId();

    /**
     * 查询评论
     *
     * @return
     */
    PageInfo<Comment> queryCommentList(String publishId, Integer page, Integer pageSize);

    PageInfo<Comment> queryCommentListVideo(String vid, Integer page, Integer pageSize);

    /**
     * 发表评论
     *
     * @param userId
     * @param publishId
     * @param content
     * @return
     */
    Boolean saveComment(Long userId, String publishId, String content);

   // Boolean saveCommentVideo(Long userId, String vid, String content);


    Long queryCommentCount(String publishId);

    Long queryCommentCountVideo(String videoId);


    public Long queryCommentCount(String publishId, CommentType type) ;

    /**
     * 喜欢
     * @param userId
     * @param publishId
     * @return
     */
     Boolean loveComment(Long userId, String publishId);

    public Boolean disLoveComment(Long userId, String publishId);

    public Long queryLoveCount(String publishId);

    public Boolean queryUserIsLove(Long userId, String publishId);


    /**
     *查询发布的动态的数量
     * @param userId
     * @return
     */
    Long queryPublishCount(Long userId);

}
